//
//  TanChuCollectionViewCell.m
//  ZhiBoYuan
//
//  Created by coder_di on 2018/5/7.
//  Copyright © 2018年 apple. All rights reserved.
//

#import "TanChuCollectionViewCell.h"

@implementation TanChuCollectionViewCell

-(void)setDiccc:(NSDictionary *)diccc{
    if ([[diccc valueForKey:@"is_right"] intValue] == 0) {
        //未答
        self.backView.backgroundColor = [UIColor whiteColor];
        self.backView.textColor = [UIColor blackColor];
    }else if ([[diccc valueForKey:@"is_right"] intValue] == 1){
        //答对
        self.backView.backgroundColor = [UIColor greenColor];
        self.backView.textColor = [UIColor whiteColor];
        
    }else{
        self.backView.backgroundColor = [UIColor redColor];
        self.backView.textColor = [UIColor whiteColor];
    }
}

-(instancetype)initWithFrame:(CGRect)frame{
    
    if (self = [super initWithFrame:frame]) {
        self.backView = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 30 * KscreenWidth,30 * KscreenHeight)];
        self.backView.layer.masksToBounds = YES;
        self.backView.layer.cornerRadius = 15 * KscreenWidth;
        self.backView.layer.borderWidth = 1;
        self.backView.layer.borderColor = [hui1Color CGColor];
        self.backView.textAlignment = NSTextAlignmentCenter;
        self.backView.font = [UIFont systemFontOfSize:15 * KscreenWidth];
        self.backView.textColor = [UIColor whiteColor];
        self.backView.backgroundColor = [UIColor redColor];
        [self.contentView addSubview:self.backView];
        
    }
    return self;
}

@end
